import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-plus'
import 'element-plus/dist/index.css'
import {createStore} from 'vuex'
const app = createApp(App)

const store = createStore({
    state () {
        return {
            count: 0,
            // 存储token
            Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : ''
        }
    },
    mutations: {
        changeLogin (state, user) {
            state.Authorization = user.Authorization;
            localStorage.setItem('Authorization', user.Authorization);
        }
    }
})


app.use(store)
app.use(router)
app.use(ElementUI)
app.mount('#app')
